<title>SC</title>
<link rel="icon" href="./../img/logo.png">
<style>
	body{
	    margin: 0;
	    padding: 0;
	    background-color: #3c91c8;
	}
	
	.search-box{
	    position: absolute;
	    top: 50%;
	    left: 50%;
	    transform: translate(-50%,-50%);
	    background: #ffffff;
	    height: 40px;
	    border-radius: 40px;
	    padding: 10px;
	    display: flex;
	    justify-content: center;
	}
	
	.search-box:hover>.search-txt{
	    width: 200px;
	    padding: 0 6px;
	}
	
	.search-box:hover>.search-btn{
	    background: white;
	}
	
	.search-btn{
	    float: right;
	    width: 40px;
	    height: 40px;
	    border-radius: 50%;
	    background: #55aaff;
	    display: flex;
	    justify-content: center;
	    align-items: center;
	    transition: 0.4s;
	}
	
	.search-txt{
	    border: none;
	    background: none;
	    outline: none;
	    float: left;
	    padding: 0;
	    color: #3c91c8;
	    font-size: 16px;
	    transition: 0.4s;
	    line-height: 40px;
	    width: 0px;
	}
	a{
		color: #55aaff;
		text-align: 20px;
	}
</style>
<body>
<div class="search-box">
	<?php
		/*include("conn.php");*/
		if(isset($_COOKIE['username'])){
		    $conn=mysqli_connect("localhost","root","10a5c81626ac5ee2","user") or die("数据库链接失败！");
			$sql="select * from user where username='".$_COOKIE['username']."'";
			$rs=mysqli_fetch_array(mysqli_query($conn,$sql));
			$code=md5($rs['username'].$rs['pwd']);
			if(!empty($rs['username']) && $_COOKIE['code']==$code){
				// echo $rs['username'].",";
				
	?>
	
            	<a class="search-txt">欢迎访问</a>
            	<a class="search-btn" href="./../Message/Message.php">
            		<img src="../img/30.png" />
            	</a>"
	
	<?php
			}else{
				echo "非法操作,<a href='login.php'>请登录</a>";
			}
		}else{
			?>
					<a class="search-txt">您尚未登录！请登陆</a>
					<a class="search-btn" href="login.php">
						<img src="../img/30.png" />
					</a>
			<?php
		}
	?>
	
</div>
</body>